package com.gongJiao.service.impl;

import com.gongJiao.entity.Info;
import com.gongJiao.mapper.InfoMapper;
import com.gongJiao.service.InfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 * @author ${author}
 * @since 2021-12-25
 */
@Service
public class InfoServiceImpl extends ServiceImpl<InfoMapper, Info> implements InfoService {
    @Autowired
    InfoMapper infoMapper;

    /**
     * 获取网站相关信息
     * @return
     */
    @Override
    public Info getInfo() {
        return infoMapper.selectById(1);
    }
    /**
     * 修改信息
     * @param info
     * @return
     */
    @Override
    public Boolean updateInfo(Info info) {
        int i = infoMapper.updateById(info);
        if (i > 0) {
            return true;
        }
        return false;
    }
}
